home *** CD-ROM | disk | FTP | other *** search
/ University of Minnesota Welcome Kit 2002 / PC Internet Tool.iso / pc / Extras / MS / WINNT / DOTCRASH.ZIP / Q178547.TXT
Encoding:
Text File  |  1998-02-26  |  4.2 KB  |  81 lines

  1. SOFTLIB: DOTCRASH creates memory dump of hung or leaking process
  2.  
  3. --------------------------------------------------------------------------
  4. The information in this article applies to:
  5.  
  6. - Microsoft Windows NT Workstation versions 3.51 and 4.0
  7. - Microsoft Windows NT Server versions 3.51 and 4.0
  8. --------------------------------------------------------------------------
  9.  
  10. SUMMARY
  11. =======
  12.  
  13. When an application runs on Windows NT you might experience problems, like a memory leak, or hanging at 0% (dead lock) or 100% (busy loop) CPU utilization.
  14.  
  15. If the computer is used in a production environment you usually do not have the time for debugging the process. In this situation, you can use DOTCRASH to create a user mode memory dump of the offending process and continue production much faster.
  16.  
  17. MORE INFORMATION
  18. ================
  19.  
  20. DOTCRASH uses Win32 API to create the memory dump. Here is how it works:
  21. 1.      Get Debug privilege (if it doesnt work, were not an Admin-like user)
  22. 2.      Resolve process name to process ID, if needed
  23. 3.      Open the target process with Full Access
  24. 4.      Change AeDebug and Dr. Watson configuration to write <process name>.dmp
  25. 5.      Create thread in target process with starting address 0xDEAD. This requires privileges acquired in 1) and 3)
  26. 6.      Return Debug privilege
  27. 7.      Restore original AeDebug and Dr. Watson configuration
  28.  
  29. DOTCRASH will not check if the files required to run Dr. Watson are installed in the system. You can check this if you run DRWTSN32 from the Start/Run dialog. While Dr. Watson is working on the memory dump it will put up a dialog. Do not click the Close or Cancel button. Wait until the OK button is enabled and then press OK.
  30.  
  31. There is a known problem with Dr. Watson on the Alpha platform on Windows NT 4.0:
  32. Q170057: Dr. Watson Dialog Box Stops Responding on DEC Alpha Platform
  33.  
  34. A fix for this problem is scheduled for Service Pack 4. The fixed file for the English version of Windows NT and Q170057 are included in the SOFTLIB file.
  35.  
  36. DOTCRASH requires PSAPI.DLL. The SOFTLIB file contains versions of this file for Windows NT 3.51 and 4.0, for the Intel and Alpha platform. If you happen to have a newer version on your system, skip this step.
  37.  
  38. The memory dump created by Dr. Watson can be loaded in WinDBG. In addition to the threads currently active in the process, there will be an additional one in 2nd chance exception. Heres an excerpt of a WinDBG session of a dump made with SPOOLSS.EXE:
  39. > ~
  40.   0     72 Stopped  4 _BaseProcessStart@4
  41.   1     78 Stopped  4 _InitializeDll@12
  42.   2     80 Stopped  4 _WaitForSingleObjectEx@12
  43.   3    557 Stopped  4 _EnumPrintersW@28
  44.   4    553 Stopped  4 _EnumPrintersW@28
  45.   5    463 Stopped  4 ?ReceiveLotsaCalls@OSF_ADDRESS@@QAEXXZ
  46.   6    149 Stopped  4 ?ReceiveLotsaCalls@WMSG_ADDRESS@@AAEXXZ
  47. * 7    540 Stopped, 2nd chance  4 0x0000dead
  48. > ~7kb
  49. FramePtr  RetAddr   Param1   Param2   Param3   Function Name
  50. 1965ffb8  77f04f2c  00000000 001420d8 0012fac4 0x0000dead
  51. 1965ffec  00000000  00000000 00000000 00000000 KERNEL32!BaseThreadStart+0x51
  52. > ~7r
  53. EAX=00000000  EBX=00000000  ECX=00000001  EDX=ffffffff  ESI=0012fac4
  54. EDI=001420d8
  55. EIP=0000dead  ESP=1965ffbc  EBP=1965ffec  EFL=00000246
  56. CS=001b  DS=0023  ES=0023  SS=0023  FS=0038  GS=0000
  57.  
  58. Heres the command line help and errorlevel information for DOTCRASH:
  59. DotCrash 1.0b by Herbert Mauerer
  60. Contact HerbertM@microsoft.com for suggestions and problem reports
  61.  
  62. usage:
  63. dotcrash <pid> | <process EXE name>
  64. pid: process ID in decimal or hex (use 0x)
  65. process EXE name: name of EXE file
  66.         If multiple EXE files with the same name are found,
  67.         errorlevel will be 1 and a list of process IDs will
  68.         be printed to STDOUT.
  69.  
  70. Errorlevel values:
  71. 0 - Success, dumped a process.
  72. 1 - Multiple processes found for %s, use process ID.
  73. 2 - Process %s not found.
  74. 3 - Invalid or out-of-range process ID.
  75. 4 - Could not open process %s, error:
  76. 5 - Could not create thread to crash the process, error:
  77. 6 - Can't get Debug Privilege. Aren't you Administrator?
  78. 7 - Could not access registry to configure Dr. Watson. Tried to fix it...
  79. 8 - This application only runs on Windows NT 3.51 or later.
  80. 9 - Ain't no killing of Process IDs 0 and 2
  81.